*------------------------------------------------------------------------------*
* Family history - Dinas, Fouka, Schläpfer - JoP
*------------------------------------------------------------------------------*

*------------------------------------------------------------------------------*
* Table D7
*------------------------------------------------------------------------------*



*------------------------------------------------------------------------------*
* Greece
*------------------------------------------------------------------------------*

use greece, clear

local treatment T
local controls female i.age i.edu i.occupation i.income i.nomos 
estimates clear
foreach x in donatest logamountst petst increasest {
	reg `x' asiaminor##T , cl(municipality)
	eststo m_`x'
	reg `x' asiaminor##T `controls', cl(municipality)
	eststo m_`x'_c
}

gen asia_T=asiaminor*T
gen nonasia_T=(1-asiaminor)*T

foreach x in donatest logamountst petst increasest {
	reg `x' asiaminor nonasia_T asia_T, cl(municipality)
	eststo extg_`x'
	reg `x' asiaminor nonasia_T asia_T  `controls', cl(municipality)
	eststo extg_`x'_c
}


*------------------------------------------------------------------------------*
* Germany
*------------------------------------------------------------------------------*

use germany, clear

rename t1 T

local treatment T
local controls i.sex i.state i.age i.F4 i.F13
foreach x in donate_st lamount_alt_st  {
	reg `x' expellee##T, cl(GKZ)
	eststo n_`x'
	reg `x' expellee##T `controls', cl(GKZ)
	eststo n_`x'_c
}

gen expellee_T=expellee*T
gen nonexpellee_T=(1-expellee)*T

foreach x in donate_st lamount_alt_st {
	reg `x' expellee nonexpellee_T expellee_T, cl(GKZ)
	eststo extd_`x'
	reg `x' expellee nonexpellee_T expellee_T `controls', cl(GKZ)
	eststo extd_`x'_c
}


esttab m* n* using Table_D7.html, star(+ 0.1 * 0.05 ** 0.01 *** 0.001) replace ///
		cells(b(fmt(a2) star) se(fmt(a2) par)) stats(N r2)  ///
		keep( 1.T 1.asiaminor 1.asiaminor#1.T 1.expellee 1.expellee#1.T) gaps 

esttab extg* extd* using Table_D7_addline.html, star(+ 0.1 * 0.05 ** 0.01 *** 0.001) replace ///
		cells(b(fmt(a2) star) se(fmt(a2) par)) stats(N r2)  ///
		keep( asia_T expellee_T) gaps 
